pull-local: Support requiring static deltas
authorDan Nicholson <nicholson@endlessm.com>
Tue, 9 Aug 2016 16:41:48 +0000 (09:41 -0700)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 10 Aug 2016 10:54:46 +0000 (10:54 +0000)
Add the --require-static-deltas option like pull to ensure static deltas
are processed for local pulls.

Closes: #447
Closes: #448
Approved by: cgwalters

src/ostree/ot-builtin-pull-local.c

index b6f649f69f8aa6cb106a3771f0c182fbabe8575e..5401a28132207a9a18e15ef83657a626a6e54588 100644 (file)
@@ -33,6 +33,7 @@
 static char *opt_remote;
 static gboolean opt_disable_fsync;
 static gboolean opt_untrusted;
+static gboolean opt_require_static_deltas;
 static gboolean opt_gpg_verify;
 static gboolean opt_gpg_verify_summary;
 static int opt_depth = 0;
@@ -41,6 +42,7 @@ static GOptionEntry options[] = {
   { "remote", 0, 0, G_OPTION_ARG_STRING, &opt_remote, "Add REMOTE to refspec", "REMOTE" },
   { "disable-fsync", 0, 0, G_OPTION_ARG_NONE, &opt_disable_fsync, "Do not invoke fsync()", NULL },
   { "untrusted", 0, 0, G_OPTION_ARG_NONE, &opt_untrusted, "Do not trust source", NULL },
+  { "require-static-deltas", 0, 0, G_OPTION_ARG_NONE, &opt_require_static_deltas, "Require static deltas", NULL },
   { "gpg-verify", 0, 0, G_OPTION_ARG_NONE, &opt_gpg_verify, "GPG verify commits (must specify --remote)", NULL },
   { "gpg-verify-summary", 0, 0, G_OPTION_ARG_NONE, &opt_gpg_verify_summary, "GPG verify summary (must specify --remote)", NULL },
   { "depth", 0, 0, G_OPTION_ARG_INT, &opt_depth, "Traverse DEPTH parents (-1=infinite) (default: 0)", "DEPTH" },
@@ -146,6 +148,8 @@ ostree_builtin_pull_local (int argc, char **argv, GCancellable *cancellable, GEr
     if (opt_remote)
       g_variant_builder_add (&builder, "{s@v}", "override-remote-name",
                              g_variant_new_variant (g_variant_new_string (opt_remote)));
+    g_variant_builder_add (&builder, "{s@v}", "require-static-deltas",
+                           g_variant_new_variant (g_variant_new_boolean (opt_require_static_deltas)));
     if (opt_gpg_verify)
       g_variant_builder_add (&builder, "{s@v}", "gpg-verify",
                              g_variant_new_variant (g_variant_new_boolean (TRUE)));